package com.wz.project.util;

/**
 * @author zn kai
 * @create 2020-03-05 18:44
 */
public class PageUtil {
    private Integer page;
    private Integer rows;

    public PageUtil() {
    }

    public PageUtil(Integer page, Integer rows) {
        if (page == 0) {
            this.page = page * rows;
            this.rows = rows;
        } else {
            this.page = page * rows;
            this.rows = (page + 1) * rows;
        }
    }

    public Integer getPage() {
        return page;
    }

    public void setPage(Integer page) {
        this.page = page;
    }

    public Integer getRows() {
        return rows;
    }

    public void setRows(Integer rows) {
        this.rows = rows;
    }

    @Override
    public String toString() {
        return "Page{" +
                "page=" + page +
                ", rows=" + rows +
                '}';
    }
}
